//
//  YRJAllHotCityModel.m
//  YanRenjie
//
//  Created by dllo on 15/10/28.
//  Copyright (c) 2015年 yanrenjie. All rights reserved.
//

#import "YRJAllHotCityModel.h"

@implementation YRJAllHotCityModel
- (void)dealloc {
    [_id release];
    [_catename release];
    [_catename_en release];
    [_photo release];
    [_lat release];
    [_lng release];
    [_beennumber release];
    [_beenstr release];
    [_representative release];
    
    [super dealloc];
}

- (instancetype)initWithId:(NSString *)id catename:(NSString *)catename catename_en:(NSString *)catename_en photo:(NSString *)photo lat:(NSString *)lat lng:(NSString *)lng beennumber:(NSString *)beennumber ishot:(BOOL)ishot beenstr:(NSString *)beenstr representative:(NSString *)representative isguide:(BOOL)isguide {
    self = [super init];
    if (self) {
        self.id = id;
        self.catename = catename;
        self.catename_en = catename_en;
        self.photo = photo;
        self.lat = lat;
        self.lng = lng;
        self.beennumber = beennumber;
        self.ishot = ishot;
        self.beenstr = beenstr;
        self.representative = representative;
        self.isguide = isguide;
    }
    return self;
}

+ (instancetype)yRJAllHotCityModelWithId:(NSString *)id catename:(NSString *)catename catename_en:(NSString *)catename_en photo:(NSString *)photo lat:(NSString *)lat lng:(NSString *)lng beennumber:(NSString *)beennumber ishot:(BOOL)ishot beenstr:(NSString *)beenstr representative:(NSString *)representative isguide:(BOOL)isguide {
    YRJAllHotCityModel *model = [[YRJAllHotCityModel alloc] initWithId:id catename:catename catename_en:catename_en photo:photo lat:lat lng:lng beennumber:beennumber ishot:ishot beenstr:beenstr representative:representative isguide:isguide];
    [model autorelease];
    return model;
}

- (void)encodeWithCoder:(NSCoder *)aCoder {
    // 对数据进行编码操作
    // 把需要归档的数据进行编码操作, 不需要的就不用写了
    [aCoder encodeObject:self.id forKey:@"id"];
    [aCoder encodeObject:self.catename forKey:@"catename"];
    [aCoder encodeObject:self.catename_en forKey:@"catename_en"];
    [aCoder encodeObject:self.photo forKey:@"photo"];
    [aCoder encodeObject:self.lat forKey:@"lat"];
    [aCoder encodeObject:self.lng forKey:@"lng"];
    [aCoder encodeObject:self.beennumber forKey:@"beennumber"];
//    [aCoder encodeObject:(id)self.ishot forKey:@"ishot"];
    [aCoder encodeObject:self.beenstr forKey:@"beenstr"];
    [aCoder encodeObject:self.representative forKey:@"representative"];
//    [aCoder encodeObject:(id)self.isguide forKey:@"isguide"];
}

- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super init];
    if (self) {
        // 解码的操作
        // 把解码后的值再赋值给属性
        self.id = [aDecoder decodeObjectForKey:@"id"];
        self.catename = [aDecoder decodeObjectForKey:@"catename"];
        self.catename_en = [aDecoder decodeObjectForKey:@"catename_en"];
        self.photo = [aDecoder decodeObjectForKey:@"photo"];
        self.lat = [aDecoder decodeObjectForKey:@"lat"];
        self.lng = [aDecoder decodeObjectForKey:@"lng"];
        self.beennumber = [aDecoder decodeObjectForKey:@"beennumber"];
//        self.ishot = [aDecoder decodeObjectForKey:@"ishot"];
        self.beenstr = [aDecoder decodeObjectForKey:@"beenstr"];
        self.representative = [aDecoder decodeObjectForKey:@"representative"];
//        self.isguide = [aDecoder decodeObjectForKey:@"isguide"];
    }
    return self;
}
@end
